<template>
    <div>
        <Header :title="'工作内容'"></Header>
        <div class="topheader page">
            <div class="fontBlack2 font40 title textL">工作内容</div>
            <van-cell-group inset class="textarea">
                <van-field v-model="message" rows="16" autosize type="textarea" maxlength="200"
                    :placeholder="placeholder" show-word-limit />
            </van-cell-group>
            <div class="bottom">
                <div @click="submit" class="font36 bgBlueFC fontWhite">保存</div>
            </div>
        </div>
    </div>
</template>

<script>
import Header from '@/components/header.vue'
import { Toast } from 'vant';
export default {
    components: {
        Header
    },
    data() {
        return {
            placeholder: '请输入工作内容',
            message: '',
            workInfo:this.$store.state.workInfo
        }
    },
    mounted() {
        this.message = this.workInfo.workContents;
    },
    methods: {
        submit() {
            if (!this.message) {
                Toast('请输入工作内容');
                return
            }
            this.workInfo.workContents = this.message;
            this.$store.commit('setworkInfo', this.workInfo);
            this.$router.replace('/experience');
        },
        goback(){
            this.$router.replace('/experience');
        }
    }
}
</script>

<style scoped>
.title {
    padding-top: 0.48rem;
    margin-bottom: 0.32rem;
    line-height: 0.56rem;
}

.tip {
    margin-bottom: 0.32rem;
}

.textarea .van-cell {
    padding: unset;
}

.van-cell-group--inset.textarea {
    margin: unset;
}

.bottom {
    position: fixed;
    width: 92%;
    padding: 0.32rem 0;
    background: white;
    bottom: 0;
}

.bottom div {
    padding: 0.24rem 2.71rem;
    border-radius: 0.48rem;
}
</style>